<%@ page contentType="text/html;charset=utf-8" language="java" 
	import="java.sql.*, 
	git.bankview.sl.db.DBConnectionFactory, git.bankview.sl.db.DBUtil" 
%><%@ include file="/jsp/inc/pageUtils.jsp"
%><jsp:useBean id="oLogon" class="git.bankview.wl.bean.LogonBean" scope="session" />
<%
	String datekeyStr = request.getParameter("datekey");
	String taskidStr = request.getParameter("taskid");
	boolean bIsNew = (null == taskidStr);
	String strTitle = bIsNew ? "新建任务" : "修改任务";
	int taskid = -1;
	java.sql.Date datekey = null;
	if (null != datekeyStr && !"".equals(datekeyStr.trim()))
		datekey = sqlDate(datekeyStr);
	else
		datekey = new java.sql.Date(new java.util.Date().getTime());
	
	Connection conn = DBConnectionFactory.getCoreConnection();
	
	try
	{ 
		if (bIsNew)
		{
			taskid = 
				DBUtil.sqlIntValue("select max(taskid) from TaskSchedule where taskid <> 99999"
					, 0, conn) + 1;
		}
		else
		{
			taskid = Integer.parseInt(taskidStr);
		}
	}
	finally
	{
		conn.close();
	}
%>
<html>
<head>
	<meta http-equiv=content-type content="text/html; charset=GBK">
	<title><%=strTitle %></title>
	<link rel="stylesheet" href="../../style/default_aux.css">
	<link rel="stylesheet" href="../../style/pp.css">
</head>
<body onload="oninit();">
	<script>appBase = "../../"</script>
	<script src="../../script/style.js" language="JavaScript"></script>
	<script src="../../script/lawindows_v0.9.js" language="JavaScript"></script>
	<script src="../../script/lajax.js" language="JavaScript"></script>
	<table cellspacing="0" class="filledframe">
		<tr>
			<td nowrap="" class="clientframe">
				<table id="oHelp" class="helper" >
					<tr>
						<td width="200" class="label">&nbsp;</td>
						<td class="help"><input type="button" class="button" title="help" onclick="help2('../../help/taskschedule.htm');" value="help" ></td>
					</tr>
				</table>
				<form action="FAKE" id="oNewForm">
					<input type="hidden" name="pageUrl" value="../../console/TaskMonitor.do">
					<div class="listtitle"><%=strTitle %></div>
					<div class="subtitle">
						<br></div>
					<table id="oPropPagesTab">
						<tr><td style="padding: 50px;"><h5>please wait...</h5></td></tr></table>
					<!---------------- generial information properties page BEGIN ----------------->
					<div id="ppGeneral">
						<table width="100%" height="100%" cellspacing="0" class="formpanel">
							<tr><td class="toppad">&nbsp;</td></tr>
							<tr><td class="input"><table cellspacing="0"><tr>
								<td nowrap class="label"><a href="javascript: help2('../../help/taskschedule.htm#taskid');">任务ID</a>:</td>
								<td nowrap ><input name="taskid" value="<%=taskid %>" size="5" maxlength="5" class="text" onkeydown="return focusMove()" onfocus="onFieldFocus()" onblur="onFieldBlur()" tabindex="101" onchange="this.modified = true;"></td>
							</tr></table></td></tr>
							<tr><td class="input"><table cellspacing="0"><tr>
								<td nowrap class="label"><a href="javascript: help2('../../help/taskschedule.htm#datekey');">任务日期</a>:</td>
								<td nowrap ><input name="datekey" value="<%=cstr(datekey) %>" size="12" maxlength="10" class="text" onkeydown="return focusMove()" onfocus="onFieldFocus()" onblur="onDateFieldBlur()" tabindex="102" onchange="this.modified = true;"></td>
								<td width="20"><img src="../../images/spacer.gif"></td>
								<td nowrap ><input type="checkbox" name="isignored" class="checkbox" tabindex="103" value="on"></td>
								<td nowrap class="label">当天不执行</td>
							</tr></table></td></tr>
							<tr><td class="input"><table cellspacing="0"><tr>
								<td nowrap class="label"><a href="javascript: help2('../../help/taskschedule.htm#taskdesc');">描述</a>:</td>
								<td nowrap ><input name="taskdesc" size="50" maxlength="64" class="text" onkeydown="return focusMove()" onfocus="onFieldFocus()" onblur="onFieldBlur()" tabindex="104"></td>
							</tr></table></td></tr>
							<tr><td class="input"><table cellspacing="0"><tr>
								<td nowrap class="label"><a href="javascript: help2('../../help/taskschedule.htm#tasktype');">类型</a>:</td>
								<td nowrap >
									<select id="oTaskClass" onchange="onTaskClassChange(this)" tabindex="105">
										<option value="">(请选择)</option>
										<option value="git.bankview.bl.pump.SimpleSqlBatch">自定义SQL批处理</option>
										<option value="git.bankview.bl.pump.SimpleSqlCheckBatch">自定义SQL检查</option>
										<option value="git.bankview.sl.schedule.CommandTask">执行本地Shell命令</option>
										<option value="git.bankview.bl.pump.RemoteShellBatch">远程Shell交互脚本</option>
										<option value="git.etl.AutoMultiTableTransporter">多表批量传输</option>
										<option value="git.etl.RemoteSqlImporter">跨数据库SQL结果集导入</option>
										<option value="git.etl.CsvTableImporter">CSV文件批量导入</option>
										<option value="git.etl.XlsTableImporter">Excel文件批量导入</option>
										<option value="git.etl.ExprEvalTask">指标计算处理任务</option>
										<option value="git.bankview.sl.schedule.SleepTask">延时任务</option>
										<option value="com.git.riskwarning.RiskWarnTask">预警管理任务</option>
										<option value="git.bankview.sl.schedule.NullTask">空任务</option>
									</select>
								</td>
								<td width="50"><img src="../../images/spacer.gif"></td>
								<td nowrap><a href="javascript: help2('../../help/taskschedule.htm#retrymax');">重试次数</a>:</td>
								<td width="20"><img src="../../images/spacer.gif"></td>
								<td nowrap ><input name="retrymax" value="0" size="5" maxlength="5" class="text" onkeydown="return focusMove()" onfocus="onFieldFocus()" onblur="onFieldBlur()" tabindex="106" title="ÌáÊ¾: -1ÎªÎÞÏÞ´ÎÖØÊÔ, 0Îª²»ÖØÊÔ"></td>
							</tr></table></td></tr>
							<tr><td class="line"><hr></td></tr>
							<tr><td class="input"><p id="oTaskClassDesc" style="text-indent: 20px; "> </p></td></tr>
							<tr><td class="bottompad">&nbsp;</td></tr>
						</table>
					</div>
					<!---------------- generial information properties page END ----------------->
					
					<!---------------- parameters page BEGIN ----------------->
					<div id="ppParams">
						<table width="100%" height="100%" cellspacing="0" class="formpanel">
							<tr><td class="toppad">&nbsp;</td></tr>
							<tr><td class="input"><table cellspacing="0" width="100%"><tr>
								<td width="150"><a href="javascript: taskhelp(oNewForm.oTaskClass.value);">属性</a></td><td width="300">值</td>
							</tr><tr>
								<td colspan="2"><div id="oParamsList"></div></td>
							</tr></table></td></tr>
							<tr><td class="input"><table cellspacing="0"><tr>
								<td id="oParamName"></td></tr></table></td></tr>
							<tr><td class="input"><textarea id="oParamValue" cols="80" rows="10" onblur="onParamValueChange()"></textarea></td></tr>
							<tr><td class="bottompad">&nbsp;</td></tr>
						</table>
					</div>
					<!---------------- parameters page END ----------------->

					<!---------------- task URL page BEGIN ----------------->
					<div id="ppUrl">
						<table width="100%" height="100%" cellspacing="0" class="formpanel">
							<tr><td class="toppad">&nbsp;</td></tr>
							<tr><td class="input"><table cellspacing="0" width="95%"><tr>
								<td nowrap>任务URL</td><td align="right"><input onclick="onTest()" type="button" class="button" value="执行"></td></tr></table></td></tr>
							<tr><td class="input"><textarea readonly id="oTaskUrl" cols="80" rows="20" name="execurl" ></textarea></td></tr>
							<tr><td class="bottompad">&nbsp;</td></tr>
						</table>
					</div>
					<!---------------- task URL page END ----------------->

					<!---------------- depends page BEGIN ----------------->
					<div id="ppDepends">
						<table width="100%" height="100%" cellspacing="0" class="formpanel">
							<tr><td class="toppad">&nbsp;</td></tr>
							<tr><td class="input"><table cellspacing="0"><tr>
								<td nowrap class="label">依赖:</td>
								<td nowrap ><input type="text" size="6" maxlength="5" class="text" id="oDepTask" 
								onkeydown="return focusMove()" onfocus="onFieldFocus()" onblur="onFieldBlur()" tabindex="271" /> </td>
								<td width="5"><img src="../../images/spacer.gif"></td>
								<td nowrap class="remark" id="oDepTaskLabel" width="155">&nbsp;</td>
								<td nowrap>
									<input type="button" tabindex="275" class="button" value="添加" onclick="onAddTaskToList(oNewForm.oDepTask, oDepTaskList, oDepTaskLabel)">
									<input type="button" tabindex="276" class="button" value="删除" onclick="deleteSelectedRow(oDepTaskList)">
									</td>
							</tr></table></td></tr>
							<tr><td class="input"><table cellspacing="0"><tr>
								<td nowrap class="label">&nbsp;</td>
								<td nowrap width="300">
									<div id="oDepTaskList"></div>
								</td>
							</tr></table></td></tr>
							<tr><td class="line"><hr></td></tr>
							<tr><td class="input"><table cellspacing="0"><tr>
								<td nowrap class="label">子任务:</td>
								<td nowrap ><input type="text" size="6" maxlength="5" class="text" id="oSubTask"
								onkeydown="return focusMove()" onfocus="onFieldFocus()" onblur="onFieldBlur()" tabindex="281"/></td>
								<td width="5"><img src="../../images/spacer.gif"></td>
								<td nowrap class="remark" id="oSubTaskLabel" width="155">&nbsp;</td>
								<td nowrap>
									<input type="button" tabindex="285" class="button" value="添加" onclick="onAddTaskToList(oNewForm.oSubTask, oSubTaskList, oSubTaskLabel)">
									<input type="button" tabindex="286" class="button" value="删除" onclick="deleteSelectedRow(oSubTaskList)">
									</td>
							</tr></table></td></tr>
							<tr><td class="input"><table cellspacing="0"><tr>
								<td nowrap class="label">&nbsp;</td>
								<td nowrap width="300">
									<div id="oSubTaskList"></div>
								</td>
							</tr></table></td></tr>
							<tr><td class="bottompad">&nbsp;</td></tr>
						</table>
					</div>
					<!---------------- depends page END ----------------->
					
					<table width="500" class="formpanelbar">
						<tr>
							<td align="right" nowrap="">
								<input type="button" tabindex="1001" class="button" value="返回" onclick="location='../../console/TaskMonitor.do?datekey=' + oNewForm.datekey.value;">
								<% if (!bIsNew) { %><input type="button" tabindex="1001" class="button" value="删除" onclick="onDeleteSubmit();"><% } %>
								<input type="button" tabindex="1001" class="button" value="提交" onclick="onFormSubmit()"></td>
						</tr>
					</table>
				</form>
			</td>
			<!-- td id="oFrame" nowrap="" class="infoframe">&nbsp;</td -->
		</tr>
	</table>
	
	<form id="oTestForm" action="TestTask.jsp" target="_blank" method="post">
		<input type="hidden" name="datekey">
		<input type="hidden" name="taskid">
		<input type="hidden" name="taskdesc">
		<input type="hidden" name="execurl">
	</form>
	<iframe id="oDataGetter" style="display: none; "></iframe>
	
<script language="javascript"><!--
var g_currPropRow = null;
var g_request = null;
var g_currTaskLabel = null;

var g_requestReload = null;
var g_requestForUpdate = null;
var g_requestForDelete = null;

function oninit()
{
	initPropertyPageTable(oPropPagesTab, 622, 360);
	addPropertyPage(oPropPagesTab, ppGeneral, "常规");
	addPropertyPage(oPropPagesTab, ppParams, "参数", "onPageTabCheck()");
	addPropertyPage(oPropPagesTab, ppUrl, "URL", "onPageTabCheck()");
	addPropertyPage(oPropPagesTab, ppDepends, "依赖");
	setPropertyPageActive(oPropPagesTab, 0);

	initSelectControl(oParamsList, "500", 120, new Array("33%", "67%"), onParamsListSelected);

	initSelectControl(oDepTaskList, "360", 100, new Array("33%", "67%"), onDepTaskSelected);
	initSelectControl(oSubTaskList, "360", 100, new Array("33%", "67%"), onSubTaskSelected);
	
	g_request = new Request();
	g_request.onCorrectResponse = onCorrTaskInfoResp;
	
<% if (!bIsNew) { %>
	g_requestReload = new Request();
	g_requestReload.onCorrectResponse = onTaskInfoResp;
	
	resetTaskInfo();
<% } %>

	g_requestForUpdate = new Request("POST", false);
	g_requestForUpdate.onCorrectResponse = onUpdateResp;
	g_requestForDelete = new Request("POST", false);
	g_requestForDelete.onCorrectResponse = onDeleteResp;
}
function resetTaskInfo()
{
	g_requestReload.send("getTaskInfo.jsp?taskid=<%=taskid%>&datekey=<%=datekeyStr%>");
}
function onUpdateResp(doc)
{
	//alert(doc.xml);
	var vResult = doc.getElementsByTagName("result");
	if (1 == vResult.length)
	{
		var vMsg = doc.getElementsByTagName("message");
		alert(vMsg[0].text);
		location = '../../console/TaskMonitor.do?datekey=' + oNewForm.datekey.value;
	}
	else
	{
		alert("服务器返回错误的信息格式");
	}
}
function onDeleteResp(doc)
{
	//alert(doc.xml);
	
	var vResult = doc.getElementsByTagName("result");
	if (1 == vResult.length)
	{
		var vMsg = doc.getElementsByTagName("message");
		var msg = vMsg[0].text;
		if ("0" != vResult[0].text)
		{
			var reason = doc.getElementsByTagName("reason")[0].text;
			msg += "\n原因: " + reason;
		}
		alert(msg);
		location = '../../console/TaskMonitor.do?datekey=' + oNewForm.datekey.value;
	}
	else
	{
		alert("服务器返回错误的信息格式");
	}
}
function onCorrTaskInfoResp(doc)
{
	//alert(doc.xml);
	
	var vId = doc.getElementsByTagName("taskid");
	var vLabel = doc.getElementsByTagName("taskdesc");
	
	if (1 == vId.length)
	{
		g_currTaskLabel.innerText = vLabel[0].text;
		var row = insertRow(g_currTaskList, new Array(vId[0].text, vLabel[0].text));
		row.value = vId[0].text;
	}
	else
	{
		g_currTaskLabel.innerText = "-- 任务未定义 --";
	}
}
function getSummary(str)
{
	return (32 > str.length ? str : (str.substring(0,30) + " ..."));
}
function onTaskInfoResp(doc)
{
	//alert(doc.xml);
	var vId = doc.getElementsByTagName("taskid");
	if (1 == vId.length)
	{
		oNewForm.taskid.value = vId[0].text;
		oNewForm.datekey.value = doc.getElementsByTagName("datekey")[0].text;
		oNewForm.taskdesc.value = doc.getElementsByTagName("taskdesc")[0].text;
		selectOptionByValue(oNewForm.oTaskClass, doc.getElementsByTagName("requestURI")[0].text);
		oNewForm.isignored.checked = ("1" == doc.getElementsByTagName("isignored")[0].text);
		oNewForm.retrymax.value = doc.getElementsByTagName("retrymax")[0].text;
		
		var rows = getAllRows(oParamsList);
		var paramNodes = doc.getElementsByTagName("requestParameter");
		var i;
		for (i = 0; i < paramNodes.length; ++i)
		{
			var j;
			for (j = 0; j < rows.length; ++j)
			{
				var reqName = paramNodes[i].attributes.getNamedItem("name").value;
				if (rows[j].pname == reqName)
				{
					rows[j].value = paramNodes[i].text;
					rows[j].cells[1].innerText = getSummary(paramNodes[i].text);
					break;
				}
			}
		}
		
		oNewForm.execurl.innerText = doc.getElementsByTagName("execurl")[0].text;
		
		paramNodes = doc.getElementsByTagName("depTask");
		setList(oDepTaskList, paramNodes);
		paramNodes = doc.getElementsByTagName("subTask");
		setList(oSubTaskList, paramNodes);
	}
	else
	{
		alert("ÎÞ·¨È¡µÃIDÎª<%=taskid%>µÄÈÎÎñÔÚ<%=datekeyStr%>µÄÖ´ÐÐÐÅÏ¢");
	}
}
function setList(oList, nodes)
{
	clearAllRows(oList);
	var i;
	for (i = 0; i < nodes.length; ++i)
	{
		var currId = nodes[i].attributes.getNamedItem("id").text;
		var row = insertRow(oList, new Array(currId, nodes[i].text));
		row.value = currId;
	}
}
function onDepTaskSelected(r)
{
	return true;
}
function onSubTaskSelected(r)
{
	return true;
}
function onPageTabCheck()
{
	return updateTaskUrl();
}
function onAutoMultiTableTransporter()
{
	var row = null;
	row = insertRow(oParamsList, new Array("*源数据源", ""));
	row.pname = "fromds"; row.value = ""; row.desc = "源数据源的JNDI名称, 不需要java:/comp之类的前缀"
	row = insertRow(oParamsList, new Array("*源库名", ""));
	row.pname = "srcschm"; row.value = ""; row.desc = "源数据库的Schema名称";
	row = insertRow(oParamsList, new Array("源库连接符", ""));
	row.pname = "stc"; row.value = ""; row.desc = "SQL中源库与表之间的连接符(缺省为“.”)";
	row = insertRow(oParamsList, new Array("目标数据源", ""));
	row.pname = "ds"; row.value = ""; row.desc = "目标数据源的JNDI名称, 不需要java:/comp之类的前缀; 缺省为默认数据源";
	row = insertRow(oParamsList, new Array("目标库名", ""));
	row.pname = "destschm"; row.value = ""; row.desc = "目标数据库的Schema名称";
	row = insertRow(oParamsList, new Array("目标库连接符", ""));
	row.pname = "dtc"; row.value = ""; row.desc = "SQL中目标库与表之间的连接符(缺省为“.”)";
	row = insertRow(oParamsList, new Array("表名", ""));
	row.pname = "tablenamepattern"; row.value = ""; row.desc = "表名, 可以使用%作为通配符; 缺省为“%源库名%”";
	row = insertRow(oParamsList, new Array("引号包围字段名", ""));
	row.pname = "qf"; row.value = ""; row.desc = "“1”：使用引号包围目标表字段名[缺省]，“0”：不使用引号";
	row = insertRow(oParamsList, new Array("库名匹配", ""));
	row.pname = "dbtabsp"; row.value = ""; row.desc = "“1”：表名以库名为前缀（以“_”分割）[缺省]，“0”：表名中不含库名";
	row = insertRow(oParamsList, new Array("匹配策略", ""));
	row.pname = "mapo"; row.value = ""; row.desc = "“1”：交集，“0”：完全匹配目标库[缺省]";
	row = insertRow(oParamsList, new Array("线程数", ""));
	row.pname = "threads"; row.value = ""; row.desc = "同时进行传输表的并发数量, 缺省为1";
	row = insertRow(oParamsList, new Array("SQL缓冲数", ""));
	row.pname = "sqlbuffs"; row.value = ""; row.desc = "每线程中的SQL缓冲区长度";
	row = insertRow(oParamsList, new Array("清空目标表", ""));
	row.pname = "truncate"; row.value = ""; row.desc = "导入到目标表前先清空目标表(“0”：不清空[缺省]，“1”：清空再导入)";
	row = insertRow(oParamsList, new Array("使用DELETE命令", ""));
	row.pname = "usedel"; row.value = ""; row.desc = "需要联合清空目标表使用(“0”：使用truncate命令[缺省]，“1”：使用DELETE命令)";
	row = insertRow(oParamsList, new Array("计划日期模板", ""));
	row.pname = "schd"; row.value = ""; row.desc = "任务执行日期模板表达式(如: “30:2009-11-30”表示每月底执行)";
	row = insertRow(oParamsList, new Array("调试", ""));
	row.pname = "debug"; row.value = ""; row.desc = "“1”：调试，“0”：不调试[缺省]";
}
function onCsvTableImporter()
{
	var row = null;
	row = insertRow(oParamsList, new Array("*源目录", ""));
	row.pname = "path"; row.value = ""; row.desc = "CSV文件存放在服务器上的目录"
	row = insertRow(oParamsList, new Array("*表名", ""));
	row.pname = "tablelist"; row.value = ""; row.desc = "一个或多个表名，多个表名用“,”分开";
	row = insertRow(oParamsList, new Array("表名前缀", ""));
	row.pname = "tabprefix"; row.value = ""; row.desc = "目标表在数据库中的名称前缀, 文件名中并不包含此前缀";
	row = insertRow(oParamsList, new Array("源字符集", ""));
	row.pname = "sourcecharset"; row.value = ""; row.desc = "CSV文件字符集; 缺省为系统默认字符集";
	row = insertRow(oParamsList, new Array("目标数据源", ""));
	row.pname = "ds"; row.value = ""; row.desc = "目标数据源的JNDI名称, 不需要java:/comp之类的前缀; 缺省为默认数据源";
	row = insertRow(oParamsList, new Array("目标Schema", ""));
	row.pname = "dschema"; row.value = ""; row.desc = "目标数据库Schema; 缺省为所有Schema";
	row = insertRow(oParamsList, new Array("目标字符集", ""));
	row.pname = "destcharset"; row.value = ""; row.desc = "目标数据库字符集; 缺省为系统默认字符集";

	row = insertRow(oParamsList, new Array("源文件字段定义", ""));
	row.pname = "coldefs"; row.value = ""; row.desc = "以分隔符分割的字段列表，当定义此列表后，文件首行将被当作数据";
	row = insertRow(oParamsList, new Array("分隔符", ""));
	row.pname = "sp"; row.value = ""; row.desc = "字段名及字段值的分隔符；缺省为“,”";
	row = insertRow(oParamsList, new Array("值引号", ""));
	row.pname = "valQuotFlg"; row.value = ""; row.desc = "字段名或值的引号符号；缺省为“\"”";
	row = insertRow(oParamsList, new Array("终结符", ""));
	row.pname = "termsymbol"; row.value = ""; row.desc = "终结符，当行首遇到终结符时，停止导入；缺省不判断终结符";
	row = insertRow(oParamsList, new Array("忽略空文件", ""));
	row.pname = "nfisok"; row.value = ""; row.desc = "“1”当文件不存在时继续执行（可以清空表）；“0”当文件不存在时中止任务[缺省]";

	row = insertRow(oParamsList, new Array("线程数", ""));
	row.pname = "threads"; row.value = ""; row.desc = "同时进行传输表的并发数量, 缺省为1";
	row = insertRow(oParamsList, new Array("SQL缓冲数", ""));
	row.pname = "sqlbuffs"; row.value = ""; row.desc = "每线程中的SQL缓冲区长度";
	row = insertRow(oParamsList, new Array("清空目标表", ""));
	row.pname = "truncate"; row.value = ""; row.desc = "导入到目标表前线清空目标表(“0”：不清空[缺省]，“1”：清空再导入)";
	row = insertRow(oParamsList, new Array("计划日期模板", ""));
	row.pname = "schd"; row.value = ""; row.desc = "任务执行日期模板表达式(如: “30:2009-11-30”表示每月底执行)";
	row = insertRow(oParamsList, new Array("日期格式", ""));
	row.pname = "dateformat"; row.value = ""; row.desc = "文件中日期字段格式, 缺省为: “yyyy-M-d”";
	row = insertRow(oParamsList, new Array("日期缺省值", ""));
	row.pname = "datedefault"; row.value = ""; row.desc = "文件中值为\"\"时的替代值, 缺省为: Null";
	row = insertRow(oParamsList, new Array("时间格式", ""));
	row.pname = "timeformat"; row.value = ""; row.desc = "文件中时间字段格式, 缺省为: “HH:m:s”";
	row = insertRow(oParamsList, new Array("时间缺省值", ""));
	row.pname = "timedefault"; row.value = ""; row.desc = "文件中值为\"\"时的替代值, 缺省为: Null";
	row = insertRow(oParamsList, new Array("日期+时间格式", ""));
	row.pname = "tsformat"; row.value = ""; row.desc = "文件中日期+时间字段格式, 缺省为: “yyyy-M-d HH:m:s”";
	row = insertRow(oParamsList, new Array("日期+时间缺省值", ""));
	row.pname = "tsdefault"; row.value = ""; row.desc = "文件中值为\"\"时的替代值, 缺省为: Null";
}
function onXlsTableImporter()
{
	var row = null;
	row = insertRow(oParamsList, new Array("*源目录", ""));
	row.pname = "path"; row.value = ""; row.desc = "CSV文件存放在服务器上的目录"
	row = insertRow(oParamsList, new Array("*表名", ""));
	row.pname = "tablelist"; row.value = ""; row.desc = "一个或多个表名，多个表名用“,”分开";
	row = insertRow(oParamsList, new Array("*目标文件字段定义", ""));
	row.pname = "coldefs"; row.value = ""; row.desc = "以','分割的字段列表，系统将按此定义及顺序将读取到的数据添加进目标表";
	row = insertRow(oParamsList, new Array("源文件列读取表达式", ""));
	row.pname = "valexprs"; row.value = ""; row.desc = "以','分割的列表达式列表，表达式可以是数字(以0开始列序号)、#(将被替换为以0开始的行序号值)、字符内容或日期表达式；缺省从0列开始顺序读取。";
	row = insertRow(oParamsList, new Array("表名前缀", ""));
	row.pname = "tabprefix"; row.value = ""; row.desc = "目标表在数据库中的名称前缀, 文件名中并不包含此前缀";
	row = insertRow(oParamsList, new Array("源字符集", ""));
	row.pname = "sourcecharset"; row.value = ""; row.desc = "Excel文件字符集; 缺省为系统默认字符集";
	row = insertRow(oParamsList, new Array("目标数据源", ""));
	row.pname = "ds"; row.value = ""; row.desc = "目标数据源的JNDI名称, 不需要java:/comp之类的前缀; 缺省为默认数据源";
	row = insertRow(oParamsList, new Array("目标Schema", ""));
	row.pname = "dschema"; row.value = ""; row.desc = "目标数据库Schema; 缺省为所有Schema";
	row = insertRow(oParamsList, new Array("目标字符集", ""));
	row.pname = "destcharset"; row.value = ""; row.desc = "目标数据库字符集; 缺省为系统默认字符集";

	row = insertRow(oParamsList, new Array("终结符", ""));
	row.pname = "termsymbol"; row.value = ""; row.desc = "终结符，当行首遇到终结符时，停止导入；缺省不判断终结符";
	row = insertRow(oParamsList, new Array("忽略空文件", ""));
	row.pname = "nfisok"; row.value = ""; row.desc = "“1”当文件不存在时继续执行（可以清空表）；“0”当文件不存在时中止任务[缺省]";

	row = insertRow(oParamsList, new Array("页序号", ""));
	row.pname = "sheetindex"; row.value = ""; row.desc = "起始为0的读取页序号；缺省为0（即读取Excel文件中的第一个sheet页）";
	row = insertRow(oParamsList, new Array("起始行", ""));
	row.pname = "rowfrom"; row.value = ""; row.desc = "起始为0的行序号；缺省为0（即从第一行开始读）";
	//row = insertRow(oParamsList, new Array("起始列", ""));
	//row.pname = "colfrom"; row.value = ""; row.desc = "起始为0的列序号；缺省为0（即从第一列开始读）";
	row = insertRow(oParamsList, new Array("读取最大行数", ""));
	row.pname = "rowmax"; row.value = ""; row.desc = "如果指定的数字不等于0，将最多读取最大行数规定的记录数；缺省为0（读取所记录）";
	row = insertRow(oParamsList, new Array("横向读取", ""));
	row.pname = "byh"; row.value = ""; row.desc = "将行／列进行转置后读取(“0”：纵向读取[缺省]，“1”：横向读取)";

	row = insertRow(oParamsList, new Array("线程数", ""));
	row.pname = "threads"; row.value = ""; row.desc = "同时进行传输表的并发数量, 缺省为1";
	row = insertRow(oParamsList, new Array("SQL缓冲数", ""));
	row.pname = "sqlbuffs"; row.value = ""; row.desc = "每线程中的SQL缓冲区长度";
	row = insertRow(oParamsList, new Array("清空目标表", ""));
	row.pname = "truncate"; row.value = ""; row.desc = "导入到目标表前线清空目标表(“0”：不清空[缺省]，“1”：清空再导入)";
	row = insertRow(oParamsList, new Array("计划日期模板", ""));
	row.pname = "schd"; row.value = ""; row.desc = "任务执行日期模板表达式(如: “30:2009-11-30”表示每月底执行)";
	row = insertRow(oParamsList, new Array("日期格式", ""));
	row.pname = "dateformat"; row.value = ""; row.desc = "文件中日期字段格式, 缺省为: “yyyy-M-d”";
	row = insertRow(oParamsList, new Array("日期缺省值", ""));
	row.pname = "datedefault"; row.value = ""; row.desc = "文件中值为\"\"时的替代值, 缺省为: Null";
	row = insertRow(oParamsList, new Array("时间格式", ""));
	row.pname = "timeformat"; row.value = ""; row.desc = "文件中时间字段格式, 缺省为: “HH:m:s”";
	row = insertRow(oParamsList, new Array("时间缺省值", ""));
	row.pname = "timedefault"; row.value = ""; row.desc = "文件中值为\"\"时的替代值, 缺省为: Null";
	row = insertRow(oParamsList, new Array("日期+时间格式", ""));
	row.pname = "tsformat"; row.value = ""; row.desc = "文件中日期+时间字段格式, 缺省为: “yyyy-M-d HH:m:s”";
	row = insertRow(oParamsList, new Array("日期+时间缺省值", ""));
	row.pname = "tsdefault"; row.value = ""; row.desc = "文件中值为\"\"时的替代值, 缺省为: Null";
}
function onExprEvalTask()
{
	var row = null;
	row = insertRow(oParamsList, new Array("*源数据表名", ""));
	row.pname = "stn"; row.value = ""; row.desc = "指标数据底层来源表";
	row = insertRow(oParamsList, new Array("*源指标代码字段", ""));
	row.pname = "ifn"; row.value = ""; row.desc = "源数据表中指标代码字段名";
	row = insertRow(oParamsList, new Array("*源指标日期字段", ""));
	row.pname = "dfn"; row.value = ""; row.desc = "指标来源表中的日期时点字段(应与任务日期等价)";
	row = insertRow(oParamsList, new Array("*源数据值字段列表", ""));
	row.pname = "vfp"; row.value = ""; row.desc = "源数据表中需要按照计算规则计算的字段列表，使用“,”分隔";
	row = insertRow(oParamsList, new Array("*配置信息查询SQL", ""));
	row.pname = "eqs"; row.value = ""; row.desc = "可以按照指标代码获取指标信息的格式SQL，结果集格式如下：ID, expr, per-type, aggr, sort-expr, grp1, cond1, [grp2, cond2[, grp3, cond3[, ...]]]";
	row = insertRow(oParamsList, new Array("*指标结果持久化SQL", ""));
	row.pname = "vps"; row.value = ""; row.desc = "可以按记录保存指标结果的格式SQL，SQL格式(?所代表的值顺序)如下：insert into (tdate, id, value, dim1, dim2, dim3, ..., sort-no) values (?,?,?,...,?)";

	row = insertRow(oParamsList, new Array("配置数据源", ""));
	row.pname = "cds"; row.value = ""; row.desc = "配置数据表所属数据源的JNDI名称, 不需要java:/comp之类的前缀; 缺省为默认数据源";
	row = insertRow(oParamsList, new Array("来源数据源", ""));
	row.pname = "sds"; row.value = ""; row.desc = "指标处理来源数据源的JNDI名称, 不需要java:/comp之类的前缀; 缺省为“配置数据源”";
	row = insertRow(oParamsList, new Array("目标数据源", ""));
	row.pname = "dds"; row.value = ""; row.desc = "指标处理结果数据源的JNDI名称, 不需要java:/comp之类的前缀; 缺省为“来源数据源”";

	row = insertRow(oParamsList, new Array("来源日期表达式", ""));
	row.pname = "sde"; row.value = ""; row.desc = "以任务日期为基准，读取来源数据的日期表达式；缺省为任务日期";
	row = insertRow(oParamsList, new Array("小数计算精度", ""));
	row.pname = "ns"; row.value = ""; row.desc = "指标计算时小数部分的保留位数(四舍五入)，缺省为5";
	row = insertRow(oParamsList, new Array("日期格式", ""));
	row.pname = "dateformat"; row.value = ""; row.desc = "文件中日期字段格式, 缺省为: “yyyy-M-d”";

	row = insertRow(oParamsList, new Array("线程数", ""));
	row.pname = "threads"; row.value = ""; row.desc = "同时进行传输表的并发数量, 缺省为1";
	row = insertRow(oParamsList, new Array("SQL缓冲数", ""));
	row.pname = "sqlbuffs"; row.value = ""; row.desc = "每线程中的SQL缓冲区长度, 缺省为100";
	
	row = insertRow(oParamsList, new Array("计划日期模板", ""));
	row.pname = "schd"; row.value = ""; row.desc = "任务执行日期模板表达式(如: “30:2009-11-30”表示每月底执行)";
}
function onSimpleSqlBatch()
{
	var row = null;
	row = insertRow(oParamsList, new Array("目标数据源", ""));
	row.pname = "ds"; row.value = ""; row.desc = "目标数据源的JNDI名称, 不需要java:/comp之类的前缀; 缺省为默认数据源";
	row = insertRow(oParamsList, new Array("*SQL", ""));
	row.pname = "sql"; row.value = ""; row.desc = "自定义执行的SQL; 多个SQL时使用';'分割";
	row = insertRow(oParamsList, new Array("启用事务", ""));
	row.pname = "transaction"; row.value = ""; row.desc = "如果为'on'且包含多个SQL, 那么这些SQL将被放在同一个事务中执行; 缺省为不启用事务";
//	row = insertRow(oParamsList, new Array("日期参数序列", ""));
//	row.pname = "params"; row.value = ""; row.desc = "SQL中对应日期参数的表达式序列";
//	row = insertRow(oParamsList, new Array("日期转换函数", ""));
//	row.pname = "dateConvertFunc"; row.value = ""; row.desc = "需要数据库对字符日期参数($D!{...}类型)进行转换时用到; 缺省为: to_date({0}, {1}); 其中{0}为日期字符串, {1}为转换格式";
	row = insertRow(oParamsList, new Array("日期格式", ""));
	row.pname = "dateFormat"; row.value = ""; row.desc = "需要数据库对字符日期参数($D!{...}类型)进行转换时用到的日期格式; 缺省为: yyyy-MM-dd";
	row = insertRow(oParamsList, new Array("计划日期模板", ""));
	row.pname = "schd"; row.value = ""; row.desc = "任务执行日期模板表达式(如: “30:2009-11-30”表示每月底执行)";
	row = insertRow(oParamsList, new Array("录入SQL字符集", ""));
	row.pname = "fics"; row.value = ""; row.desc = "录入SQL使用的字符集(GBK/ISO8859_1...)";
	row = insertRow(oParamsList, new Array("数据库字符集", ""));
	row.pname = "focs"; row.value = ""; row.desc = "数据库使用的字符集(GBK/ISO8859_1...)";
}
function onRemoteSqlImporter()
{
	var row = null;
	row = insertRow(oParamsList, new Array("源数据源", ""));
	row.pname = "fromds"; row.value = ""; row.desc = "源数据源的JNDI名称, 不需要java:/comp之类的前缀; 缺省为默认数据源";
	row = insertRow(oParamsList, new Array("*SQL", ""));
	row.pname = "sql"; row.value = ""; row.desc = "自定义执行的SQL, 用于生成导入的结果集; ";
	row = insertRow(oParamsList, new Array("*目标表名", ""));
	row.pname = "table"; row.value = ""; row.desc = "将要导入数据的目标表名称";
	row = insertRow(oParamsList, new Array("SQL缓冲数", ""));
	row.pname = "sqlbuffs"; row.value = ""; row.desc = "每线程中的SQL缓冲区长度";
	row = insertRow(oParamsList, new Array("目标表清理SQL", ""));
	row.pname = "prepare"; row.value = ""; row.desc = "可为目标表指定一个或多个清理SQL)";
	row = insertRow(oParamsList, new Array("源SQL日期格式", ""));
	row.pname = "dateFormat"; row.value = ""; row.desc = "查询源数据时需要数据库对字符日期参数($D!{...}类型)进行转换时用到的日期格式; 缺省为: yyyy-MM-dd";
	row = insertRow(oParamsList, new Array("目标表清理SQL日期格式", ""));
	row.pname = "prepareDateFormat"; row.value = ""; row.desc = "清理目标表时需要数据库对字符日期参数($D!{...}类型)进行转换时用到的日期格式; 缺省为: yyyy-MM-dd";
	row = insertRow(oParamsList, new Array("计划日期模板", ""));
	row.pname = "schd"; row.value = ""; row.desc = "任务执行日期模板表达式(如: “30:2009-11-30”表示每月底执行)";
	row = insertRow(oParamsList, new Array("源SQL字符集", ""));
	row.pname = "fics"; row.value = ""; row.desc = "源结果集SQL使用的字符集(GBK/ISO8859_1...)";
	row = insertRow(oParamsList, new Array("清理SQL字符集", ""));
	row.pname = "focs"; row.value = ""; row.desc = "清理目标表SQL使用的字符集(GBK/ISO8859_1...)";

	row = insertRow(oParamsList, new Array("源数据库字符集", ""));
	row.pname = "sdcs"; row.value = ""; row.desc = "源查询结果集使用的字符集(GBK/ISO8859_1...)";
	row = insertRow(oParamsList, new Array("目标数据库字符集", ""));
	row.pname = "ddcs"; row.value = ""; row.desc = "插入目标数据库需要使用的字符集(GBK/ISO8859_1...)";
}
function onSimpleSqlCheckBatch()
{
	var row = null;
	row = insertRow(oParamsList, new Array("目标数据源", ""));
	row.pname = "ds"; row.value = ""; row.desc = "目标数据源的JNDI名称, 不需要java:/comp之类的前缀; 缺省为默认数据源";
	row = insertRow(oParamsList, new Array("*SQL", ""));
	row.pname = "sql"; row.value = ""; row.desc = "自定义执行的SQL;";
	row = insertRow(oParamsList, new Array("检查方法", ""));
	row.pname = "perform"; row.value = ""; row.desc = "*: 存在记录时通过(缺省); n: 存在n条记录时通过, n >= 0; (m): 当第一条记录第一个字段值为“m”时通过";
//	row = insertRow(oParamsList, new Array("日期转换函数", ""));
//	row.pname = "dateConvertFunc"; row.value = ""; row.desc = "需要数据库对字符日期参数($D!{...}类型)进行转换时用到; 缺省为: to_date({0}, {1}); 其中{0}为日期字符串, {1}为转换格式";
	row = insertRow(oParamsList, new Array("日期格式", ""));
	row.pname = "dateFormat"; row.value = ""; row.desc = "日期转换函数可能用到的日期格式; 缺省为: yyyy-MM-dd";
	row = insertRow(oParamsList, new Array("计划日期模板", ""));
	row.pname = "schd"; row.value = ""; row.desc = "任务执行日期模板表达式(如: “30:2009-11-30”表示每月底执行)";
	row = insertRow(oParamsList, new Array("录入SQL字符集", ""));
	row.pname = "fics"; row.value = ""; row.desc = "录入SQL使用的字符集(GBK/ISO8859_1...)";
	row = insertRow(oParamsList, new Array("数据库字符集", ""));
	row.pname = "focs"; row.value = ""; row.desc = "数据库使用的字符集(GBK/ISO8859_1...)";
}
function onCommandTask()
{
	var row = null;
	row = insertRow(oParamsList, new Array("*Shell命令", ""));
	row.pname = "commands"; row.value = ""; row.desc = "命令集合, 可使用日期参数($D!{...});";
	row = insertRow(oParamsList, new Array("Shell名", ""));
	row.pname = "shell"; row.value = ""; row.desc = "Shell执行名, Unix/Linux下可以是sh/ksh等, Windows下可以空缺";
	row = insertRow(oParamsList, new Array("忽略shell执行结果", ""));
	row.pname = "ignorecmdresult"; row.value = ""; row.desc = "1：系统忽略shell命令返回值的异常；0：命令行返回值异常时任务失败(缺省)";
	row = insertRow(oParamsList, new Array("日期格式", ""));
	row.pname = "dateFormat"; row.value = ""; row.desc = "日期转换函数可能用到的日期格式; 缺省为: yyyy-MM-dd";
	row = insertRow(oParamsList, new Array("计划日期模板", ""));
	row.pname = "schd"; row.value = ""; row.desc = "任务执行日期模板表达式(如: “30:2009-11-30”表示每月底执行)";
	row = insertRow(oParamsList, new Array("Shell字符集", ""));
	row.pname = "charset"; row.value = ""; row.desc = "Shell字符集(UTF-8/GBK/ISO8859_1...)";
}
function onRemoteShellBatch()
{
	var row = null;
	row = insertRow(oParamsList, new Array("*目标主机地址", ""));
	row.pname = "host"; row.value = ""; row.desc = "目标主机地址，可以是IP或机器名";
	row = insertRow(oParamsList, new Array("端口", ""));
	row.pname = "port"; row.value = ""; row.desc = "目标主机telnet端口，缺省为：23";
	row = insertRow(oParamsList, new Array("*交互命令", ""));
	row.pname = "commands"; row.value = ""; row.desc = "交互式命令格式: @{prompt-length,prompt}command，#开头行为注释行，执行时将输出至log；";
	row = insertRow(oParamsList, new Array("连接超时", ""));
	row.pname = "ctimeout"; row.value = ""; row.desc = "连接主机超时时间(ms)；缺省为系统值";
	row = insertRow(oParamsList, new Array("操作超时", ""));
	row.pname = "stimeout"; row.value = ""; row.desc = "操作超时时间(ms)；缺省为系统值";
	row = insertRow(oParamsList, new Array("计划日期模板", ""));
	row.pname = "schd"; row.value = ""; row.desc = "任务执行日期模板表达式(如: “30:2009-11-30”表示每月底执行)";
}
function onNullTask()
{
}
function onSleepTask()
{
	var row = null;
	row = insertRow(oParamsList, new Array("延时时长", ""));
	row.pname = "timeout"; row.value = ""; row.desc = "延时时长(ms)；默认为0";
}

function onRiskWarnTask()
{
	var row = null;
	row = insertRow(oParamsList, new Array("日期格式", ""));
	row.pname = "dateformat"; row.value = ""; row.desc = "文件中日期字段格式, 缺省为: “yyyy-M-d”";

}

function onParamValueChange()
{
	if (null != g_currPropRow)
	{
		if (undefined != oNewForm.oParamValue.value)
			g_currPropRow.value = oNewForm.oParamValue.value;
		else
			g_currPropRow.value = oNewForm.oParamValue.innerText;
		
		g_currPropRow.cells(1).innerText = getSummary(g_currPropRow.value);
	}
}
function onParamsListSelected(row)
{
/*	if (null != g_currPropRow)
	{
		g_currPropRow.cells(1).innerText = oNewForm.oParamValue.innerText;
		g_currPropRow.value = oNewForm.oParamValue.innerText;
	}
*/
	g_currPropRow = row;
	
	if (undefined != oNewForm.oParamValue.value)
		oNewForm.oParamValue.value = row.value;
	else
		oNewForm.oParamValue.innerText = row.value;
	
	oParamName.innerText = row.desc;
	return true;
}
function onFormSubmit()
{
	if ("" == oNewForm.taskid.value)
	{
		setPropertyPageActive(oPropPagesTab, 0);
		alert("缺少任务ID");
	}
	else if ("" == oNewForm.taskdesc.value)
	{
		setPropertyPageActive(oPropPagesTab, 0);
		alert("缺少任务描述");
	}
	else if (!updateTaskUrl())
		return false;
	else if (!setAndCheckTaskParams())
		return false;
	else
	{
		setParameters(oNewForm, "depTaskIds", oDepTaskList, "value");
		setParameters(oNewForm, "subTaskIds", oSubTaskList, "value");
		g_requestForUpdate.send("handleTaskUpdate.jsp", oNewForm);
		clearParameters(oNewForm, "depTaskIds");
		clearParameters(oNewForm, "subTaskIds");
	}
	
	return false;
}
function onDeleteSubmit()
{
	if (undefined != oNewForm.taskid.modified)
		alert("任务ID已经修改, 请重新刷新页面再提交删除请求");
	else if (undefined != oNewForm.datekey.modified)
		alert("起始日期已经修改, 请重新刷新页面再提交删除请求");
	else if (confirm("确定要删除任务" + oNewForm.taskid.value + "吗?"))
	{
		g_requestForDelete.send("handleTaskDelete.jsp", oNewForm);
		clearParameters(oNewForm, "depTaskIds");
		clearParameters(oNewForm, "subTaskIds");
	}
}
function setAndCheckTaskParams()
{
	var rows = getAllRows(oParamsList);
	var i;
	for (i = 0; i < rows.length; ++i)
	{
		if ("" == rows[i].value && "*" == rows[i].cells[0].innerText.substring(0, 1))
		{
			setPropertyPageActive(oPropPagesTab, 1);
			alert("缺少参数“" + rows[i].cells[0].innerText + "”的值");
			return false;
		}
		else if (0 <= rows[i].value.indexOf("&"))
		{
			setPropertyPageActive(oPropPagesTab, 1);
			alert("参数“" + rows[i].cells[0].innerText + "”中包含系统保留字符“&”");
			return false;
		}
	}
	return true;
}
function onTaskClassChange(c)
{
	var v = c.value.split(".");
	var pf = v[v.length - 1];
	clearAllRows(oParamsList);		
	g_currPropRow = null;
	oNewForm.oParamValue.innerText = "";
	oParamName.innerText = "";
	
	if ("git.etl.AutoMultiTableTransporter" == c.value)
		oTaskClassDesc.innerText = "按一定规则将符合条件的表自动从一个数据源传输到另一个数据源";
	else if ("git.etl.CsvTableImporter" == c.value)
		oTaskClassDesc.innerText = "从指定位置导入一个或多个CSV文件";
	else if ("git.etl.ExprEvalTask" == c.value)
		oTaskClassDesc.innerText = "可以按照指定配置表中的计算规则，对数据源进行处理并保存到结果表中。";
	else if ("git.etl.XlsTableImporter" == c.value)
		oTaskClassDesc.innerText = "从指定位置导入一个或多个Excel文件";
	else if ("git.bankview.bl.pump.SimpleSqlBatch" == c.value)
		oTaskClassDesc.innerText = "在一个数据源中执行自定义SQL，可带多个日期参数";
	else if ("git.bankview.bl.pump.SimpleSqlCheckBatch" == c.value)
		oTaskClassDesc.innerText = "在一个数据源中执行自定义SQL检查，当返回特定结果时通过";
	else if ("git.bankview.sl.schedule.CommandTask" == c.value)
		oTaskClassDesc.innerText = "在服务器主机本地执行Shell命令，可带多个日期参数";
	else if ("git.bankview.bl.pump.RemoteShellBatch" == c.value)
		oTaskClassDesc.innerHTML = "可以通过Telnet协议, 登录至远程主机并执行指定交互式命令或Shell; \n交互式命令如下面的样式: @{prompt-length,prompt}command\n下面是一个登录主机并等待Shell提示符的实例：\n@{6,login:}qthbb\n@{9,Password:}qthbb\n@{10,:/baobiao>}";
	else if ("git.bankview.sl.schedule.NullTask" == c.value)
		oTaskClassDesc.innerText = "可作为多个任务线程的结束依赖节点";
	else if ("git.bankview.sl.schedule.SleepTask" == c.value)
		oTaskClassDesc.innerText = "可延时指定时间";
	else if ("com.git.riskwarning.RiskWarnTask" == c.value)
		oTaskClassDesc.innerText = "预警管理";
	else if ("git.etl.RemoteSqlImporter" == c.value)
		oTaskClassDesc.innerText = "可将从某数据源通过单一SQL查询出的结果集导入目标库";
	else
		oTaskClassDesc.innerText = "请选择一种任务类型";
		
	if (1 < v.length)
		eval("on" + pf + "();");
}
function updateTaskUrl()
{
	if ("" == oNewForm.oTaskClass.value)
	{
		setPropertyPageActive(oPropPagesTab, 0);
		oNewForm.oTaskClass.focus();
		alert("必须选择一个任务类型");
		return false;
	}

	var taskUrl = "class://" + oNewForm.oTaskClass.value;
	var rows = getAllRows(oParamsList);
	var bHasAnd = false;
	var i;
	for (i = 0; i < rows.length; ++i)
	{
		if ("" != rows[i].value)
		{
			if (bHasAnd)
			{
				taskUrl += "&";
			}
			else
			{
				taskUrl += "?";
				bHasAnd = true;
			}
			
			taskUrl += rows[i].pname + "=" + rows[i].value;
		}
	}
	
	if (isIE())
		oNewForm.oTaskUrl.innerText = taskUrl;
	else
		oNewForm.oTaskUrl.textContent = taskUrl;
	
	return true;
}
function onAddTaskToList(obj, oList, oLabel)
{
	var taskid = obj.value;
	if (parseInt(taskid) != taskid)
	{
		alert("缺少任务ID");
		return false;
	}
	
	if (0 <= indexOfRow(oList, taskid))
	{
		alert("任务已经存在");
		return false;
	}
	
	g_currTaskLabel = oLabel;
	g_currTaskList = oList;
	
	g_request.send("getTaskInfo.jsp?taskid=" + taskid + "&datekey=" + oNewForm.datekey.value);
}
function taskhelp(tc)
{
	var idx = tc.lastIndexOf(".");
	help2('../../help/taskschedule.htm#' + tc.substring(idx + 1));
}
function onTest()
{
	if ("" == oNewForm.taskid.value)
	{
		alert("缺少任务ID");
	}
	else if ("" == oNewForm.datekey.value)
	{
		alert("缺少任务日期");
	}
	else if (oNewForm.execurl.value && "" == oNewForm.execurl.value 
		|| !oNewForm.execurl.value && "" == oNewForm.execurl.innerText)
	{
		alert("请先设置任务信息");
	}
	else if (confirm("系统将按\"" + oNewForm.taskid.value + "\"定义, 立即执行本次任务(" + oNewForm.datekey.value + "), 任务涉及到的数据更新将被正式提交!\n\n确认这样做吗?"))
	{
		oTestForm.taskid.value = oNewForm.taskid.value;
		oTestForm.datekey.value = oNewForm.datekey.value;
		oTestForm.taskdesc.value = oNewForm.taskdesc.value;
		oTestForm.execurl.value = 
			(oNewForm.execurl.value ? oNewForm.execurl.value : oNewForm.execurl.innerText);
		oTestForm.submit();
	}
}
--></script>

</body>
</html>

